﻿using UnityEngine;
using System.Collections;

namespace CinemaDirector
{
    //[CutsceneItemAttribute("Cool", "Set Play Speed", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
    public class SetPlaySpeed : CinemaActorEvent
    {
        // Options for reverting in editor.
        [SerializeField]
        private RevertMode editorRevertMode = RevertMode.Revert;

        // Options for reverting during runtime.
        [SerializeField]
        private RevertMode runtimeRevertMode = RevertMode.Revert;

        [SerializeField]
        public float PlaySpeed = 1;
        private float prePlaySpeed;

        public override void Trigger(GameObject actor)
        {
            var charTrackGroup = ActorTrackGroup as CharacterTrackGroup;
            prePlaySpeed = charTrackGroup.PlaySpeed;
            charTrackGroup.PlaySpeed = PlaySpeed;
        }
// 
//         /// <summary>
//         /// Reverse this event and set time scale back to it's previous state.
//         /// </summary>
//         public override void Reverse(GameObject Actor)
//         {
//             var charTrackGroup = ActorTrackGroup as CharacterTrackGroup;
//             charTrackGroup.PlaySpeed = prePlaySpeed;
//         }
// 
//         /// <summary>
//         /// Option for choosing when this Event will Revert to initial state in Editor.
//         /// </summary>
//         public RevertMode EditorRevertMode
//         {
//             get { return editorRevertMode; }
//             set { editorRevertMode = value; }
//         }
// 
//         /// <summary>
//         /// Option for choosing when this Event will Revert to initial state in Runtime.
//         /// </summary>
//         public RevertMode RuntimeRevertMode
//         {
//             get { return runtimeRevertMode; }
//             set { runtimeRevertMode = value; }
//         }
    }
}